﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Spaanjaars.ContactManager.Infrastructure.Validation
{
    public class InvalidDomainObjectException : ApplicationException
    {
        private readonly string _errorMessage;
        private readonly IEnumerable<IBrokenRule> _brokenRules;

        public InvalidDomainObjectException(string errorMessage, IEnumerable<IBrokenRule> brokenRules)
        {
            _errorMessage = errorMessage;
            _brokenRules = brokenRules;
        }

        public static void ThrowWith(string errorMessage, List<IBrokenRule> brokenRules)
        {
            throw new InvalidDomainObjectException(errorMessage, brokenRules);
        }
    }
}
